<template>
	<div class="home">
		<Banner></Banner>
		<Icons></Icons>
		<Tabs></Tabs>
		<Category :category="categoryVueList"></Category>
		<Splike :propspike="splikeList"></Splike>
		<Newsp></Newsp>
		<IndexDest></IndexDest>
		<Travel></Travel>
		<!-- 红包小组件 -->
		<Honbao></Honbao>
		<!-- 底部菜单 -->
		<BottomNav :prop="1" ></BottomNav>
	</div>
</template>

<script>
	// 引入Banner组件
	import Banner from './pages/Banner.vue';
	// 引入Icons组件
	import Icons from './pages/Icons.vue'
	// 引入Tabs组件
	import Tabs from './pages/Tabs.vue';
	// 引入Category组件
	import Category from './pages/Category.vue';
	// 引入Splike组件
	import Splike from './pages/Splike.vue';
	// 引入Newsp组件
	import Newsp from './pages/Newsp.vue';
	// 引入红包小组件
	import Honbao from './pages/Honbao.vue';
	// 引入公共组件-底部
	import BottomNav from '../default/BottomNav.vue';
	// 引入IndexDest组件
	import IndexDest from './pages/IndexDest.vue';
	// 引入Travel组件
	import Travel from './pages/Travel.vue';
	// 引入函数
	import {mapState} from 'vuex';
	export default
	{
		name : 'Home',
		components:{
			Banner,
			Icons,
			Tabs,
			Splike,
			Newsp,
			BottomNav,
			Category,
			Honbao,
			IndexDest,
			Travel
		},
		data(){
			return {
				splikeList : [],
				categoryVueList : []
			}
		},
		computed:{
			...mapState(['cityName'])
		},
		created(){
			let that = this;
			this.axios.get( '/api/dataHome.json' ).then( (res)=>{
				// console.log(res.data.Homemsg[0]);
				let data = res.data.Homemsg[0];
				for( let index in res.data.Homemsg ){
					if( res.data.Homemsg[index].city == this.cityName ){
						data = res.data.Homemsg[index];
						// console.log(data);
					}
				}
				that.splikeList = data.SplikeVueList;
				that.categoryVueList=data.CategoryList
			} ).catch( (error)=>{
				console.log(error);
			} );
		}
	}
</script>

<style scoped>
	.home{
		
	}
</style>
